
import { defAxios as request } from "@/utils/http/index.js";

export function useManageApi() {
    return {
        userSave,
        userDelete,
        userUpdateStatus,
        userModifyPassword,
        userResetPassword,
        getUserRouterPermission,
        getUserRoleAgInfo
    }
}

function userSave(params) {
    return request({
        url: '/user/save',
        method: 'post',
        data: params
    })
}
function userDelete(params) {
    return request({
        url: '/user/delete',
        method: 'post',
        data: params
    })
}
function userUpdateStatus(params) {
    return request({
        url: '/user/updateStatus',
        method: 'post',
        data: params
    })
}
function userModifyPassword(params) {
    return request({
        url: '/user/modifyPassword',
        method: 'post',
        data: params
    })
}
function userResetPassword(params) {
    return request({
        url: '/user/resetPassword',
        method: 'post',
        data: params
    })
}

/**
 * 获取用户角色菜单权限
 *
 * @returns axios
 */
function getUserRouterPermission() {
    return request({
        url: '/user/getUserRouterPermission',
        method: 'post',
    })
}

function getUserRoleAgInfo(guid) {
    return request({
        url: `/user/getRoleAgInfo/${guid}`,
        method: 'get',
    })
}


